package com.sky.business.sys.event;

import lombok.Data;
import lombok.NoArgsConstructor;

import java.math.BigDecimal;

/**
 * 调整设备信息事件
 *
 */
@Data
@NoArgsConstructor
public class AdJustDeviceInfoEvent extends BaseEvent {

    private Metadata metadata;

    /**
     * 构造器
     * @param edgeId 边缘中心id
     * @param deviceId 设备id
     * @param longitude 经度
     * @param latitude 纬度
     * @param altitude 海拔
     * @param panAngleTrim 水平偏差角
     * @param tiltAngleTrim 垂直偏差角
     */
    public AdJustDeviceInfoEvent(String edgeId, String deviceId,BigDecimal longitude,BigDecimal latitude,BigDecimal altitude,BigDecimal panAngleTrim,BigDecimal tiltAngleTrim){
        super("AdjustDeviceInfo",edgeId);
        DeviceInfo deviceInfo = new DeviceInfo();
        deviceInfo.longitude = longitude;
        deviceInfo.latitude = latitude;
        deviceInfo.altitude = altitude;
        deviceInfo.panAngleTrim = panAngleTrim;
        deviceInfo.tiltAngleTrim = tiltAngleTrim;
        metadata = new Metadata();
        metadata.setDeviceId(deviceId);
        metadata.setDeviceInfo(deviceInfo);
    }

    @Data
    public static class Metadata  extends DeviceMetadata{
        private DeviceInfo deviceInfo;
    }

    @Data
    public static class DeviceInfo {
        private BigDecimal longitude;
        private BigDecimal latitude;
        private BigDecimal altitude;
        private BigDecimal panAngleTrim;
        private BigDecimal tiltAngleTrim;
    }
}
